<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>emplist</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" th:href="@{/css/style.css}"/>
</head>
<body>
<div id="wrap">
    <div id="top_content">
        <div id="header">
            <div id="rightheader">
                <p>
                    2020/5/1
                    <br/>
                </p>
            </div>
            <div id="topheader">
                <h1 id="title">
                    <a href="#">主界面</a>
                </h1>
            </div>
            <div id="navigation">
            </div>
        </div>
        <div id="content">
            <p id="whereami">
            </p>
            <h1>
                Welcome <span th:text="${session.user.username}"/>!
            </h1>
            <table class="table">
                <tr class="table_header">
                    <td>
                        ID
                    </td>
                    <td>
                        Name
                    </td>
                    <td>
                        Salary
                    </td>
                    <td>
                        Age
                    </td>
                    <td>
                        Birth
                    </td>
                    <td>
                        Operation
                    </td>
                </tr>
                <tr class="row1" th:each="emp:${emps}">
                    <td>
                        <span th:text="${emp.id}"></span>
                    </td>
                    <td>
                        <span th:text="${emp.name}"></span>
                    </td>
                    <td>
                        <span th:text="${emp.salary}"></span>
                    </td>
                    <td>
                        <span th:text="${emp.age}"></span>
                    </td>
                    <td>
                        <!--日期格式化-->
                        <span th:text="${#dates.format(emp.bir,'yyyy-MM-dd')}"></span>
                    </td>

                    <td>
                        <a th:href="@{/emp/delete(id=${emp.id})}">删除信息</a>&nbsp;
                        <a th:href="@{/emp/find(id=${emp.id})}">修改信息</a>
                    </td>
                </tr>

            </table>
            <p>
                <input type="button" class="button" value="添加员工" onclick="location.href='/ems/toSave'"/>
            </p>
        </div>
    </div>
    <div id="footer">
        <div id="footer_bg">
            Sawyer
        </div>
    </div>
</div>
</body>
</html>
